package com.gkd.springboot_employeeadmin.service.Imp;

import com.gkd.springboot_employeeadmin.mapper.EmployeeMapper;
import com.gkd.springboot_employeeadmin.pojo.Employee;
import com.gkd.springboot_employeeadmin.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeServiceImp implements EmployeeService {

    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public List<Employee> allemp() {
        return employeeMapper.allemp();
    }

    @Override
    public int addEmploy(Employee employee) {
        return employeeMapper.addEmploy(employee);
    }

    @Override
    public int updateEmp(Employee employee) {
        return employeeMapper.updateEmp(employee);
    }

    @Override
    public Employee queryEmpById(int id) {
        return employeeMapper.queryEmpById(id);
    }

    @Override
    public int deleteEmpById(int id) {
        return employeeMapper.deleteEmpById(id);
    }

    @Override
    public List<Employee> pagebean(int indexpage, int pageSize) {
        return employeeMapper.pagebean(indexpage,pageSize);
    }

    @Override
    public int sumemp() {
        return employeeMapper.sumemp();
    }
}
